import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
import _createClass from 'babel-runtime/helpers/createClass';
import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
import _inherits from 'babel-runtime/helpers/inherits';
/**
 * 带权限校验的MenuItem组件，兼容antd.Menu.Item
 * @author: ljq
 * @since: 2019-01-12 15:46:51
 */
import * as React from 'react';
import { Menu } from 'antd';
import AuthCheck from '../auth-check';
var MenuItem = Menu.Item;

var MenuItemAuth = function (_React$Component) {
    _inherits(MenuItemAuth, _React$Component);

    function MenuItemAuth() {
        _classCallCheck(this, MenuItemAuth);

        return _possibleConstructorReturn(this, (MenuItemAuth.__proto__ || Object.getPrototypeOf(MenuItemAuth)).apply(this, arguments));
    }

    _createClass(MenuItemAuth, [{
        key: 'render',
        value: function render() {
            var _props = this.props,
                children = _props.children,
                check = _props.check;

            return React.createElement(
                AuthCheck,
                { check: check },
                React.createElement(
                    MenuItem,
                    this.props,
                    children
                )
            );
        }
    }]);

    return MenuItemAuth;
}(React.Component);

export default MenuItemAuth;